<?php
/* Smarty version 3.1.29, created on 2022-08-24 12:57:39
  from "D:\developers\project\vwins\addons\system\template\index.tpl" */

if ($_smarty_tpl->smarty->ext->_validateCompiled->decodeProperties($_smarty_tpl, array (
  'has_nocache_code' => false,
  'version' => '3.1.29',
  'unifunc' => 'content_6305afc3f2d260_11978570',
  'file_dependency' => 
  array (
    'd5d5056a207c5e5134007329c9f0447ce0329869' => 
    array (
      0 => 'D:\\developers\\project\\vwins\\addons\\system\\template\\index.tpl',
      1 => 1470714540,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:header_user.tpl' => 1,
    'file:information.tpl' => 1,
    'file:footer.tpl' => 1,
  ),
),false)) {
function content_6305afc3f2d260_11978570 ($_smarty_tpl) {
if (!is_callable('smarty_function_ddb_pc')) require_once 'D:\\developers\\project\\vwins\\include\\libraries\\smarty\\plugins\\function.ddb_pc.php';
?>

<!DOCTYPE html>
<html>
<head lang="zh-CN">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>首页 - <?php echo $_smarty_tpl->tpl_vars['BASE_NAME']->value;?>
</title>
    <link rel="stylesheet" href="<?php echo $_smarty_tpl->tpl_vars['CSS_PATH']->value;?>
normalize.css"/>
    <link rel="stylesheet" href="<?php echo $_smarty_tpl->tpl_vars['CSS_PATH']->value;?>
global.css"/>
    <link rel="stylesheet" href="<?php echo $_smarty_tpl->tpl_vars['CSS_PATH']->value;?>
alert.css"/>
    <link rel="stylesheet" href="<?php echo $_smarty_tpl->tpl_vars['CSS_PATH']->value;?>
font-awesome.css"/>
    <link rel="stylesheet" href="<?php echo $_smarty_tpl->tpl_vars['NOW_PATH']->value;?>
css/style.css"/>
    <link rel="stylesheet" href="<?php echo $_smarty_tpl->tpl_vars['CSS_PATH']->value;?>
iealert.css"/>
    <?php echo '<script'; ?>
 type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['JS_PATH']->value;?>
jquery-1.11.0.js"><?php echo '</script'; ?>
>
    <?php echo '<script'; ?>
 type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['JS_PATH']->value;?>
jquery.alert.js"><?php echo '</script'; ?>
>
    <?php echo '<script'; ?>
 type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['JS_PATH']->value;?>
jquery.cookie.js"><?php echo '</script'; ?>
>
    <?php echo '<script'; ?>
 type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['JS_PATH']->value;?>
jquery.form.min.js"><?php echo '</script'; ?>
>
    <?php echo '<script'; ?>
 type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['JS_PATH']->value;?>
jquery.browser.js"><?php echo '</script'; ?>
>
    <?php echo '<script'; ?>
 type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['JS_PATH']->value;?>
iealert.js"><?php echo '</script'; ?>
>
    <?php echo '<script'; ?>
 type="text/javaScript">$(document).ready(function() { $("body").iealert(); });<?php echo '</script'; ?>
>
</head>
<body>

<div class="content-box">
    <?php $_smarty_tpl->smarty->ext->_subtemplate->render($_smarty_tpl, "file:header_user.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

    <?php echo '<script'; ?>
>$('#head-nav-menu>li:eq(0)').addClass('active');<?php echo '</script'; ?>
>
</div>

<div class="wrapper content-box">
    <?php $_smarty_tpl->smarty->ext->_subtemplate->render($_smarty_tpl, "file:information.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

    <div class="main">
        <div class="hd">
            <h1 class="title">公众号/服务窗首页</h1>
        </div>
        <div class="bd">
            <div class="section">
                <div class="control-group relative">
                    <a href="<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
add/" class="button button-primary button-rounded">+添加接入</a>
                    <?php if (isopenweixin(true)) {?>
                        &nbsp;
                        <a href="<?php echo $_smarty_tpl->tpl_vars['_A']->value['url']['index'];?>
open/weixin/auth/" onclick="_openweixin();"
                           class="button button-success button-rounded" target="_blank">+微信公众号授权接入</a>
                    <?php }?>
                    <p class="description">还没有公众号/服务窗？
                        <a class="normal-link" href="https://mp.weixin.qq.com/" target="_blank">点击申请公众号</a>
                        <a class="normal-link" href="https://fuwu.alipay.com/" target="_blank">点击申请服务窗</a>
                    </p>
                    <?php if ($_smarty_tpl->tpl_vars['user']->value['admin'] && $_smarty_tpl->tpl_vars['userlist']->value) {?>
                        <div class="filteral">
                            <select id="filteral" onchange="_filteral(this)">
                                <option value="0">=按用户筛选列表=</option>
                                <?php
$_from = $_smarty_tpl->tpl_vars['userlist']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_list_0_saved_item = isset($_smarty_tpl->tpl_vars['list']) ? $_smarty_tpl->tpl_vars['list'] : false;
$_smarty_tpl->tpl_vars['list'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['list']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['list']->value) {
$_smarty_tpl->tpl_vars['list']->_loop = true;
$__foreach_list_0_saved_local_item = $_smarty_tpl->tpl_vars['list'];
?>
                                    <option value="<?php echo $_smarty_tpl->tpl_vars['list']->value['userid'];?>
">
                                        <?php echo $_smarty_tpl->tpl_vars['list']->value['username'];
if ($_smarty_tpl->tpl_vars['list']->value['companyname']) {?> (公司:<?php echo $_smarty_tpl->tpl_vars['list']->value['companyname'];?>
)<?php }?>
                                    </option>
                                <?php
$_smarty_tpl->tpl_vars['list'] = $__foreach_list_0_saved_local_item;
}
if ($__foreach_list_0_saved_item) {
$_smarty_tpl->tpl_vars['list'] = $__foreach_list_0_saved_item;
}
?>
                            </select>
                            <?php if ($_smarty_tpl->tpl_vars['filter']->value) {
echo '<script'; ?>
>$("#filteral").val("<?php echo $_smarty_tpl->tpl_vars['filter']->value;?>
");<?php echo '</script'; ?>
><?php }?>
                        </div>
                    <?php }?>
                </div>
                <table class="table table-primary">
                    <thead>
                    <tr>
                        <th align="left" class="heading" colspan="2">
                            公众号/服务窗列表
                            <span class="text text-primary text-extra-small">(点击下方功能模块，进入管理)</span>
                            <span class="search">
                                <input type="text" id="key" placeholder="搜索：公众号/服务窗" value="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
" data-val="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
"><span class="search_btn">搜</span>
                                <div class="search_del"></div>
                            </span>
                        </th>
                    </tr>
                    </thead>
                    <tbody id="users_al_list">
                    <?php echo smarty_function_ddb_pc(array('set'=>"数据表:users_al,列表名:lists,显示数目:10,分页显示:1,分页名:pagelist,当前页:GET[page],分页地址:".((string)$_smarty_tpl->tpl_vars['pageurl']->value)."?key=".((string)$_smarty_tpl->tpl_vars['key']->value)."&page=(?),排序:".((string)$_smarty_tpl->tpl_vars['ordersql']->value),'where'=>$_smarty_tpl->tpl_vars['wheresql']->value),$_smarty_tpl);?>

                    <?php
$_from = $_smarty_tpl->tpl_vars['lists']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_list_1_saved_item = isset($_smarty_tpl->tpl_vars['list']) ? $_smarty_tpl->tpl_vars['list'] : false;
$_smarty_tpl->tpl_vars['list'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['list']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['list']->value) {
$_smarty_tpl->tpl_vars['list']->_loop = true;
$__foreach_list_1_saved_local_item = $_smarty_tpl->tpl_vars['list'];
?>
                        <?php $_smarty_tpl->smarty->ext->_var->createLocalArrayVariable($_smarty_tpl, 'list', null);
$_smarty_tpl->tpl_vars['list']->value['setting'] = string2array($_smarty_tpl->tpl_vars['list']->value['setting']);
$_smarty_tpl->ext->_updateScope->updateScope($_smarty_tpl, 'list', 0);?>
                        <tr<?php if ($_smarty_tpl->tpl_vars['list']->value['wx_level'] == 7) {?> class="wx_corp"<?php }?>>
                            <td colspan="2" class="al-name" title="ID：<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
">
                                <?php if ($_smarty_tpl->tpl_vars['list']->value['id'] == $_smarty_tpl->tpl_vars['slastalid']->value) {?><span class="lastal">最后使用</span><?php }?>
                                <?php if ($_smarty_tpl->tpl_vars['list']->value['wx_name']) {?>
                                    <span id="wx_name">
                                        <?php if ($_smarty_tpl->tpl_vars['list']->value['wx_level'] == 7) {?>企业号：<?php } else { ?>公众号：<?php }
echo $_smarty_tpl->tpl_vars['list']->value['wx_name'];?>

                                        <?php if ($_smarty_tpl->tpl_vars['list']->value['setting']['other']['get_appid']) {?>
                                            <em class="toget" title="借用网页授权登录">借授权</em>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['list']->value['setting']['other']['getjs_appid']) {?>
                                            <em class="toget" title="借用 JS 分享接口">借JSSDK</em>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['list']->value['setting']['openweixin'] && isopenweixin($_smarty_tpl->tpl_vars['list']->value['setting']['openweixin'])) {?>
                                            <?php echo openauth_expires($_smarty_tpl->tpl_vars['list']->value['setting']['openweixin_expires']);?>

                                        <?php }?>
                                    </span>
                                <?php }?>
                                <?php if ($_smarty_tpl->tpl_vars['list']->value['al_name']) {?><span id="al_name">服务窗：<?php echo $_smarty_tpl->tpl_vars['list']->value['al_name'];?>
</span><?php }?>
                                <?php if ($_smarty_tpl->tpl_vars['user']->value['admin']) {?>
                                    <a class="openfunc" href="<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[1];?>
system/settings/users/?openfunc=<?php echo $_smarty_tpl->tpl_vars['list']->value['userid'];?>
&openalid=<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
">添加功能</a>
                                    <div class="openfunc_w">
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[1];?>
system/settings/users/?openfunc=<?php echo $_smarty_tpl->tpl_vars['list']->value['userid'];?>
&openalid=<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
">管理员身份</a>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
openfunc/?openalid=<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
">客户身份</a>
                                    </div>
                                    <span class="subordinate"><a class="normal-link" href="<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[1];?>
system/settings/users/?t=high&username=<?php echo urlencode($_smarty_tpl->tpl_vars['list']->value['username']);?>
">&copy; <?php if ($_smarty_tpl->tpl_vars['list']->value['companyname']) {
echo $_smarty_tpl->tpl_vars['list']->value['companyname'];
} else { ?><span title="用户名：<?php echo $_smarty_tpl->tpl_vars['list']->value['username'];?>
"><?php echo $_smarty_tpl->tpl_vars['list']->value['username'];?>
</span><?php }?></a></span>
                                <?php } else { ?>
                                    <a class="openfunc" href="<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
openfunc/?openalid=<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
">添加功能</a>
                                <?php }?>
                            </td>
                        </tr>
                        <tr id="list-<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
"<?php if ($_smarty_tpl->tpl_vars['list']->value['wx_level'] == 7) {?> class="wx_corp"<?php }?>>
                            <td class="ifunlist" id="ifunlist" width="875">
                                <div class="button-groups">
                                    <?php
$_from = string2array($_smarty_tpl->tpl_vars['list']->value['function']);
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_list2_2_saved_item = isset($_smarty_tpl->tpl_vars['list2']) ? $_smarty_tpl->tpl_vars['list2'] : false;
$_smarty_tpl->tpl_vars['list2'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['list2']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['list2']->value) {
$_smarty_tpl->tpl_vars['list2']->_loop = true;
$__foreach_list2_2_saved_local_item = $_smarty_tpl->tpl_vars['list2'];
?>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[1];
echo $_smarty_tpl->tpl_vars['list2']->value['title_en'];?>
/?al=<?php echo $_smarty_tpl->tpl_vars['list2']->value['alid'];?>
&uf=<?php echo $_smarty_tpl->tpl_vars['list2']->value['ida'];?>
"
                                           class="button button-primary button-rounded button-small"><?php echo $_smarty_tpl->tpl_vars['list2']->value['title'];?>
</a>
                                        <?php
$_smarty_tpl->tpl_vars['list2'] = $__foreach_list2_2_saved_local_item;
}
if (!$_smarty_tpl->tpl_vars['list2']->_loop) {
?>
                                        无
                                    <?php
}
if ($__foreach_list2_2_saved_item) {
$_smarty_tpl->tpl_vars['list2'] = $__foreach_list2_2_saved_item;
}
?>
                                    <label class="button-input">
                                        <input type="text" name="fun-search" placeholder="输入名称搜索"><em></em>
                                    </label>
                                </div>
                            </td>
                            <td class="al-center">
                                <div class="button-groups action">
                                    <a href="javascript:_del(<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
);" class="button button-primary button-rounded button-extra-small">删除</a>
                                    <a href="<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
add/<?php echo $_smarty_tpl->tpl_vars['list']->value['id'];?>
/" class="button button-primary button-rounded button-extra-small">编辑</a>
                                </div>
                            </td>
                        </tr>
                        <?php
$_smarty_tpl->tpl_vars['list'] = $__foreach_list_1_saved_local_item;
}
if (!$_smarty_tpl->tpl_vars['list']->_loop) {
?>
                        <tr>
                            <td colspan="4" align="center" class="align-center">无</td>
                        </tr>
                    <?php
}
if ($__foreach_list_1_saved_item) {
$_smarty_tpl->tpl_vars['list'] = $__foreach_list_1_saved_item;
}
?>
                    </tbody>
                </table>
                <div id="pagelist" class="clearfix">
                    <a href="javascript:void(0);" style="cursor:default">总数量<?php echo $_smarty_tpl->tpl_vars['pagelist_info']->value['total_rows'];?>
个</a>
                    <?php echo $_smarty_tpl->tpl_vars['pagelist']->value;?>

                </div>
            </div>
        </div>
    </div>
</div>

<?php echo '<script'; ?>
 type="text/javascript">
    function _filteral(obj) {
        $.alert("加载中...", 0);
        window.location.href = '<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
?filter='+$(obj).val();
    }
    function _del(id){
        var _del = art.dialog({
            fixed: true,
            lock: true,
            opacity: '.3',
            content: '您确定要删除并且删除后不可恢复吗？',
            button: [{
                name: '确定删除',
                focus: true,
                callback: function () {
                    $.ajax({
                        url:'<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
del/'+id+'/',
                        type:"get",
                        success: function (data) {
                            _del.close();
                            $.showModal('删除成功！', '<?php echo $_smarty_tpl->tpl_vars['urlarr']->value['now'];?>
');
                        },
                        cache: false
                    });
                    return false;
                }
            },{
                name: '取消',
                callback: function () {
                    return true;
                }
            }]

        });
    }
    window.__showbg = false;
    function _showbg(j) {
        if ($("div.ifunall-showbg").length == 0) {
            var $intemp = $("<div class='ifunall-showbg' id='"+Math.round(Math.random() * 10000)+"'></div>");
            $intemp.mouseover(function(){ $intemp.remove(); });
            $("body").append($intemp);
            setTimeout(function(){
                $("div.ifunall-showbg").animate({opacity:"0.3"}, 'slow');
            }, 200);

        }
    }
    $(document).ready(function() {
        $(".openfunc").mousemove(function () {
            if ($(this).next().hasClass("openfunc_w")){
                $(this).next().show();
                $(this).next().css({top:$(this).position().top, left: $(this).position().left});
            }
        }).mouseout(function () {
            if ($(this).next().hasClass("openfunc_w")){
                $(this).next().hide();
            }
        });
        $('.openfunc_w').mousemove(function () {
            $(this).show();
        }).mouseout(function () {
            $(this).hide();
        });
        //
        $("td#ifunlist div").mouseover(function(){
            var sh = $(this).outerHeight();
            $(this).addClass("ifunall");
            _showbg();
            var eh = $(this).outerHeight();
            if (eh/sh >= 2){
                $(this).addClass("ifunallb");
            }
        }).mouseout(function(){
            $(this).removeClass("ifunall");
            $(this).removeClass("ifunallb");
        });
        //
        var search_del = $(".search_del");
        var search_btn = $(".search_btn");
        var search_key = $("#key");
        search_btn.click(function(){
            var key = $.trim(search_key.val());
            if (key) {
                window.location.href = "<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
?key="+key;
            }else{
                $.cookie('_index_key', '', { expires: -1, path: '<?php echo @constant('BASE_DIR');?>
' });
                if (search_key.attr("data-val") != "") { window.location.href = "<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
"; }

            }
        });
        $(".search>input,.search_del").mouseover(function(){
            if ($.trim(search_key.val()) != "") { search_del.show(); }
        }).mouseout(function(){
            search_del.hide();
        });
        search_del.click(function(){
            search_key.val("");
            search_btn.click();
        });
        search_key.keydown(function(e){
            if(e.keyCode == 13){ search_btn.click(); }
        });
        if ($.trim(search_key.val()) != "") {
            if ($("#users_al_list").find("tr").length > 1) {
                $.cookie('_index_key', $.trim(search_key.val()), { expires: 7, path: '<?php echo @constant('BASE_DIR');?>
' });
            }else{
                $.cookie('_index_key', '', { expires: -1, path: '<?php echo @constant('BASE_DIR');?>
' });
            }
        }
        $("label.button-input").find("input").keyup(function(){
            var thisv = $(this).val();
            var thisg = $(this).parents(".button-groups");
            thisg.find("a").each(function(){
                var thisa = $(this).text();
                if (thisv) {
                    thisa = thisa.replace(thisv, '<font color="red">'+thisv+'</font>');
                }
                $(this).html(thisa);
            });
        });
        <?php if ($_smarty_tpl->tpl_vars['_A']->value['u']['admin'] == 1) {?>
        <?php if ($_smarty_tpl->tpl_vars['_release']->value != "99") {?>
        $.ajax({
            url:'<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
version/',
            type:"GET",
            dataType: 'json',
            success: function (data) {
                if (data != null && data.success != null && data.success) {
                    var intemp = $('<a class="indexuptis" href="<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
settings/upgrade/?winopen=1">检测到新版本：'+data.message+'，点击查看详情！</a>');
                    $("body").append(intemp);
                    intemp.css({"margin-left": intemp.outerWidth()/2 * -1}).show();
                }else{
                    _versionapp();
                }
            },
            cache: false
        });
        <?php } elseif ($_smarty_tpl->tpl_vars['_apprele']->value != "99") {?>
        _versionapp();
        <?php }?>
        <?php }?>
    });
    function _versionapp() {
        $.ajax({
            url:'<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
versionapp/',
            type:"GET",
            dataType: 'json',
            success: function (data) {
                if (data != null && data.success != null && data.success) {
                    var intemp = $('<a class="indexuptis" href="<?php echo $_smarty_tpl->tpl_vars['urlarr']->value[2];?>
settings/functions/?winopen=1">检测到功能应用有新版本，点击查看详情！</a>');
                    $("body").append(intemp);
                    intemp.css({"margin-left": intemp.outerWidth()/2 * -1}).show();
                }
            },
            cache: false
        });
    }
    function _openweixin() {
        art.dialog({
            title: '微信公众号登录授权',
            fixed: true,
            lock: true,
            content: '请在新窗口中完成微信公众号登录授权，点击授权成功刷新列表。',
            button: [{
                name: '授权成功',
                focus: true,
                callback: function () {
                    $.alert("正在刷新...", 0, 1);
                    window.location.reload();
                    return true;
                }
            },{
                name: '关闭提示',
                callback: function () {
                    return true;
                }
            }]
        });
    }
<?php echo '</script'; ?>
>
<?php $_smarty_tpl->smarty->ext->_subtemplate->render($_smarty_tpl, "file:footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>


</body>
</html><?php }
}
